<?php
$clearfix = '';
if (!$name) $name = $block['#name'];
$blockinner = intval ($block['#block-inner']);
//gen special begin markup (markup=1/2/3)
//1: basic - nothing; 2: advanced - left & right ; 3: complex - top - middle -bottom
$markup = intval ($block['#markup']);
switch ($markup) {
	case 2:
		?>
		<div class="l"></div>
		<div class="block-inner clearfix">
		<?php
		break;
	case 3:
		?>
		<div class="top"><div class="tl"></div><div class="tr"></div></div>
		<div class="mid clearfix"><div class="ml"></div>
		<div class="block-inner clearfix">
		<?php
		break;
	case 1:
	default:
		break;
}
?>

<?php if ($blockinner):
for ($i=1;$i<=$blockinner;$i++):
if ($i==$blockinner) $clearfix = ' clearfix';
?> 
	<div class="block-inner<?php echo $i.$clearfix ?>">
<?php endfor; 
endif;
?>

{content}

<?php 
$clearfix = '';
$name = $block['#name'];
$blockinner = intval ($block['#block-inner']);

?>
<?php if ($blockinner):
for ($i=1;$i<=$blockinner;$i++):
?> 
	</div>
<?php endfor; 
endif; ?> 

<?php 		
//gen special end markup (markup=1/2/3)
//1: basic - nothing; 2: advanced - left & right ; 3: complex - top - middle -bottom
$markup = intval ($block['#markup']);
switch ($markup) {
	case 2:
		?>
		</div> <?php //for inner ?>
		<div class="r"></div>
		<?php
		break;
	case 3:
		?>
		</div> <?php //for inner ?>
		<div class="mr"></div></div> <?php //for mid ?>
		<div class="bot"><div class="bl"></div><div class="br"></div></div>
		<?php
		break;
	case 1:
	default:
		break;
}